package com.ruoyi.qiushi.service.user.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.user.MemberUser;
import com.ruoyi.qiushi.mapper.user.MemberUserMapper;
import com.ruoyi.qiushi.service.user.IMemberUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户信息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-08
 */
@Service
public class MemberUserServiceImpl implements IMemberUserService {
    @Autowired
    private MemberUserMapper memberUserMapper;

    /**
     * 查询用户信息
     *
     * @param id 用户信息主键
     * @return 用户信息
     */
    @Override
    public MemberUser selectMemberUserById(Long id) {
        return memberUserMapper.selectMemberUserById(id);
    }

    /**
     * 查询用户信息列表
     *
     * @param memberUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<MemberUser> selectMemberUserList(MemberUser memberUser) {
        return memberUserMapper.selectMemberUserList(memberUser);
    }

    /**
     * 新增用户信息
     *
     * @param memberUser 用户信息
     * @return 结果
     */
    @Override
    public int insertMemberUser(MemberUser memberUser) {
        memberUser.setCreateTime(DateUtils.getNowDate());
        return memberUserMapper.insertMemberUser(memberUser);
    }

    /**
     * 修改用户信息
     *
     * @param memberUser 用户信息
     * @return 结果
     */
    @Override
    public int updateMemberUser(MemberUser memberUser) {
        memberUser.setUpdateTime(DateUtils.getNowDate());
        return memberUserMapper.updateMemberUser(memberUser);
    }

    /**
     * 删除用户信息信息
     *
     * @param id 用户信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberUserById(Long id) {
        return memberUserMapper.deleteMemberUserById(id);
    }
}
